from django.db import models

from urls.basemodel import BaseModel


# Create your models here.

class Nav(BaseModel):
    name = models.CharField(max_length=32, verbose_name='导航名称')
    url = models.CharField(max_length=128, verbose_name='导航链接')
    ishttp = models.BooleanField(default=False, verbose_name='是否是http平台')
    position = models.IntegerField(default=1, verbose_name='导航位置')

    class Meta:
        db_table = 'fgnav'

    def __str__(self):
        return self.name

class Banner(BaseModel):
    title = models.CharField(max_length=64, verbose_name='图片名称')
    ishttp = models.BooleanField(default=False, verbose_name='是否为链接')
    imgurl = models.CharField(max_length=256, verbose_name='图片路径')
    url = models.CharField(max_length=256, verbose_name='跳转的路径')

    class Meta:
        db_table = 'fgbanner'

    def __str__(self):
        return self.title